﻿<UserControl x:Class="WpfKlip.ExclusionsList"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:wpfklp="clr-namespace"
             mc:Ignorable="d" xmlns:WpfKlip_Properties="clr-namespace:WpfKlip.Properties">
    <Grid Margin="5">
        <Grid.RowDefinitions>
            <RowDefinition Height="*"/>
            <RowDefinition Height="auto"/>
        </Grid.RowDefinitions>
        <ListBox Grid.Row="0" x:Name="Actionslist" FontFamily="Courier New">
            <ListBox.ContextMenu>
                <ContextMenu >
                    <ContextMenu.Items>
                        <MenuItem Header="Refresh List" Click="RefreshProcessListButton_Click"/>
                        <MenuItem Header="Reset" Click="Button_Click"/>
                        <StackPanel Orientation="Horizontal"> 
                            <Label Content="Default Behavior: "></Label>
                            <ComboBox x:Name="DefaultActionSelector" Margin="0,3,0,3">
                                <ComboBox.Items>
                                    <ComboBoxItem>Accept</ComboBoxItem>
                                    <ComboBoxItem>Deny</ComboBoxItem>
                                </ComboBox.Items>
                            </ComboBox>
                        </StackPanel>
                    </ContextMenu.Items>
                </ContextMenu>
            </ListBox.ContextMenu>
            <ListBox.ItemTemplate>
                <DataTemplate>
                    <Grid  HorizontalAlignment="Stretch" Margin ="5"> 
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="24" />
                            <ColumnDefinition Width="218" />
                            <ColumnDefinition Width="62" />
                        </Grid.ColumnDefinitions>
                        <Image Source="{Binding Path=Icon}" Width="24"></Image>
                        <Label HorizontalAlignment="Stretch" Grid.Column="1" Content="{Binding Path=ProcessName}" ToolTip="{Binding Path=Info}" Margin="5,3,5,0" VerticalContentAlignment="Center"></Label>
                        <ComboBox  Tag="{Binding}" Grid.Column="2" SelectedIndex="{Binding Path=Action}" Width="62" Margin="0,3,0,3" FontFamily="Segoe UI" SelectionChanged="ComboBox_SelectionChanged">
                            <ComboBox.Items>
                                <ComboBoxItem>Accept</ComboBoxItem>
                                <ComboBoxItem>Deny</ComboBoxItem>
                            </ComboBox.Items>
                        </ComboBox>
                    </Grid>
                </DataTemplate>
            </ListBox.ItemTemplate>
        </ListBox>
    </Grid>
</UserControl>
